package com.sfy.controller;

import com.sfy.dao.ElectricMapper;
import com.sfy.entity.Electric;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class ElectricController {
    @Autowired
    private ElectricMapper electricMapper;
    @RequestMapping("/selectElectricList")
    public List<Electric> selectElectricList(Electric electric){
        return electricMapper.selectElectric(electric);
    }
    @RequestMapping("/getElectricCount")
    public int getCostCount(Electric electric){
        int total = electricMapper.getCount(electric);
        return total;
    }
}
